package com.hanyxx.coll;

/**
 * @author layman
 * @date 2021/2/26
 */
public class Demo06 {
    public static void main(String[] args) {
        int sum = Demo06.getSum(1,2,3,4,5,6,7,8,9,10);
        System.out.println(sum);
        sum = Demo06.getSum(10,20,30,40,50);
        System.out.println(sum);
    }
    public static int getSum(int...arr){
        System.out.println(arr);
        System.out.println(arr.length);
        int sum = 0;
        for (int i : arr) {
            sum += i;
        }
        return sum;
    }
}
